const state = {
  routes: []
}

const mutations = {
  SET_KEEP_ALIVE: (state, data) => {
    state.routes = data
  },
  CLEAR_KEEP_ALIVE: state => {
    state.routes = []
  }
}

const actions = {
  setKeepAlive({ commit }, data) {
    commit('SET_KEEP_ALIVE', data)
  },
  clearKeepAlive({ commit }) {
    commit('CLEAR_KEEP_ALIVE')
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
